package com.unionpay.mpds.model;

// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Device entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_DEVICE", uniqueConstraints = @UniqueConstraint(columnNames = "DEVICE_CODE"))
public class Device implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -7159139077179118841L;
	private String factoryId;
	private String modelId;
	private String deviceSn;
	private String deviceCode;
	private String deviceStatus;
	private String deviceAttach;
	private String deviceLatitude;
	private String deviceLongitude;
	private Integer deviceCnttotal;
	private Integer deviceSuccess;
	private String deviceDisplay;
	private String devicePinpad;
	private String devicePrinter;
	private String deviceKeyboard;
	private String deviceReader;
	private String deviceAddress;
	private String deviceInstalldate;
	private String posNo;
	private String shopNo;
	private String instNo;

	// Constructors

	/** default constructor */
	public Device() {
	}

	/** minimal constructor */
	public Device(String factoryId, String modelId, String deviceSn,
			String deviceCode, String deviceStatus, String deviceAttach,
			Integer deviceCnttotal, Integer deviceSuccess,
			String deviceDisplay, String devicePinpad, String devicePrinter,
			String deviceKeyboard, String deviceReader, String posNo,
			String shopNo, String instNo) {
		this.factoryId = factoryId;
		this.modelId = modelId;
		this.deviceSn = deviceSn;
		this.deviceCode = deviceCode;
		this.deviceStatus = deviceStatus;
		this.deviceAttach = deviceAttach;
		this.deviceCnttotal = deviceCnttotal;
		this.deviceSuccess = deviceSuccess;
		this.deviceDisplay = deviceDisplay;
		this.devicePinpad = devicePinpad;
		this.devicePrinter = devicePrinter;
		this.deviceKeyboard = deviceKeyboard;
		this.deviceReader = deviceReader;
		this.posNo = posNo;
		this.shopNo = shopNo;
		this.instNo = instNo;
	}

	/** full constructor */
	public Device(String factoryId, String modelId, String deviceSn,
			String deviceCode, String deviceStatus, String deviceAttach,
			String deviceLatitude, String deviceLongitude,
			Integer deviceCnttotal, Integer deviceSuccess,
			String deviceDisplay, String devicePinpad, String devicePrinter,
			String deviceKeyboard, String deviceReader, String deviceAddress,
			String deviceInstalldate, String posNo, String shopNo, String instNo) {
		this.factoryId = factoryId;
		this.modelId = modelId;
		this.deviceSn = deviceSn;
		this.deviceCode = deviceCode;
		this.deviceStatus = deviceStatus;
		this.deviceAttach = deviceAttach;
		this.deviceLatitude = deviceLatitude;
		this.deviceLongitude = deviceLongitude;
		this.deviceCnttotal = deviceCnttotal;
		this.deviceSuccess = deviceSuccess;
		this.deviceDisplay = deviceDisplay;
		this.devicePinpad = devicePinpad;
		this.devicePrinter = devicePrinter;
		this.deviceKeyboard = deviceKeyboard;
		this.deviceReader = deviceReader;
		this.deviceAddress = deviceAddress;
		this.deviceInstalldate = deviceInstalldate;
		this.posNo = posNo;
		this.shopNo = shopNo;
		this.instNo = instNo;
	}

	// Property accessors

	@Id
	@Column(name = "FACTORY_ID", nullable = false, length = 3)
	public String getFactoryId() {
		return this.factoryId;
	}

	public void setFactoryId(String factoryId) {
		this.factoryId = factoryId;
	}

	@Column(name = "MODEL_ID", nullable = false, length = 3)
	public String getModelId() {
		return this.modelId;
	}

	public void setModelId(String modelId) {
		this.modelId = modelId;
	}

	@Column(name = "DEVICE_SN", nullable = false, length = 16)
	public String getDeviceSn() {
		return this.deviceSn;
	}

	public void setDeviceSn(String deviceSn) {
		this.deviceSn = deviceSn;
	}

	@Id
	@GeneratedValue
	@Column(name = "DEVICE_CODE", unique = true, nullable = false, length = 16)
	public String getDeviceCode() {
		return this.deviceCode;
	}

	public void setDeviceCode(String deviceCode) {
		this.deviceCode = deviceCode;
	}

	@Column(name = "DEVICE_STATUS", nullable = false, length = 1)
	public String getDeviceStatus() {
		return this.deviceStatus;
	}

	public void setDeviceStatus(String deviceStatus) {
		this.deviceStatus = deviceStatus;
	}

	@Column(name = "DEVICE_ATTACH", nullable = false, length = 1)
	public String getDeviceAttach() {
		return this.deviceAttach;
	}

	public void setDeviceAttach(String deviceAttach) {
		this.deviceAttach = deviceAttach;
	}

	@Column(name = "DEVICE_LATITUDE", length = 10)
	public String getDeviceLatitude() {
		return this.deviceLatitude;
	}

	public void setDeviceLatitude(String deviceLatitude) {
		this.deviceLatitude = deviceLatitude;
	}

	@Column(name = "DEVICE_LONGITUDE", length = 10)
	public String getDeviceLongitude() {
		return this.deviceLongitude;
	}

	public void setDeviceLongitude(String deviceLongitude) {
		this.deviceLongitude = deviceLongitude;
	}

	@Column(name = "DEVICE_CNTTOTAL", nullable = false)
	public Integer getDeviceCnttotal() {
		return this.deviceCnttotal;
	}

	public void setDeviceCnttotal(Integer deviceCnttotal) {
		this.deviceCnttotal = deviceCnttotal;
	}

	@Column(name = "DEVICE_SUCCESS", nullable = false)
	public Integer getDeviceSuccess() {
		return this.deviceSuccess;
	}

	public void setDeviceSuccess(Integer deviceSuccess) {
		this.deviceSuccess = deviceSuccess;
	}

	@Column(name = "DEVICE_DISPLAY", nullable = false, length = 1)
	public String getDeviceDisplay() {
		return this.deviceDisplay;
	}

	public void setDeviceDisplay(String deviceDisplay) {
		this.deviceDisplay = deviceDisplay;
	}

	@Column(name = "DEVICE_PINPAD", nullable = false, length = 1)
	public String getDevicePinpad() {
		return this.devicePinpad;
	}

	public void setDevicePinpad(String devicePinpad) {
		this.devicePinpad = devicePinpad;
	}

	@Column(name = "DEVICE_PRINTER", nullable = false, length = 1)
	public String getDevicePrinter() {
		return this.devicePrinter;
	}

	public void setDevicePrinter(String devicePrinter) {
		this.devicePrinter = devicePrinter;
	}

	@Column(name = "DEVICE_KEYBOARD", nullable = false, length = 1)
	public String getDeviceKeyboard() {
		return this.deviceKeyboard;
	}

	public void setDeviceKeyboard(String deviceKeyboard) {
		this.deviceKeyboard = deviceKeyboard;
	}

	@Column(name = "DEVICE_READER", nullable = false, length = 1)
	public String getDeviceReader() {
		return this.deviceReader;
	}

	public void setDeviceReader(String deviceReader) {
		this.deviceReader = deviceReader;
	}

	@Column(name = "DEVICE_ADDRESS", length = 80)
	public String getDeviceAddress() {
		return this.deviceAddress;
	}

	public void setDeviceAddress(String deviceAddress) {
		this.deviceAddress = deviceAddress;
	}

	@Column(name = "DEVICE_INSTALLDATE", length = 8)
	public String getDeviceInstalldate() {
		return this.deviceInstalldate;
	}

	public void setDeviceInstalldate(String deviceInstalldate) {
		this.deviceInstalldate = deviceInstalldate;
	}

	@Column(name = "POS_NO", nullable = false, length = 8)
	public String getPosNo() {
		return this.posNo;
	}

	public void setPosNo(String posNo) {
		this.posNo = posNo;
	}

	@Column(name = "SHOP_NO", nullable = false, length = 15)
	public String getShopNo() {
		return this.shopNo;
	}

	public void setShopNo(String shopNo) {
		this.shopNo = shopNo;
	}

	@Column(name = "INST_NO", nullable = false, length = 15)
	public String getInstNo() {
		return this.instNo;
	}

	public void setInstNo(String instNo) {
		this.instNo = instNo;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof Device))
			return false;
		Device castOther = (Device) other;

		return ((this.getFactoryId() == castOther.getFactoryId()) || (this
				.getFactoryId() != null && castOther.getFactoryId() != null && this
				.getFactoryId().equals(castOther.getFactoryId())))
				&& ((this.getModelId() == castOther.getModelId()) || (this
						.getModelId() != null && castOther.getModelId() != null && this
						.getModelId().equals(castOther.getModelId())))
				&& ((this.getDeviceSn() == castOther.getDeviceSn()) || (this
						.getDeviceSn() != null
						&& castOther.getDeviceSn() != null && this
						.getDeviceSn().equals(castOther.getDeviceSn())))
				&& ((this.getDeviceCode() == castOther.getDeviceCode()) || (this
						.getDeviceCode() != null
						&& castOther.getDeviceCode() != null && this
						.getDeviceCode().equals(castOther.getDeviceCode())))
				&& ((this.getDeviceStatus() == castOther.getDeviceStatus()) || (this
						.getDeviceStatus() != null
						&& castOther.getDeviceStatus() != null && this
						.getDeviceStatus().equals(castOther.getDeviceStatus())))
				&& ((this.getDeviceAttach() == castOther.getDeviceAttach()) || (this
						.getDeviceAttach() != null
						&& castOther.getDeviceAttach() != null && this
						.getDeviceAttach().equals(castOther.getDeviceAttach())))
				&& ((this.getDeviceLatitude() == castOther.getDeviceLatitude()) || (this
						.getDeviceLatitude() != null
						&& castOther.getDeviceLatitude() != null && this
						.getDeviceLatitude().equals(
								castOther.getDeviceLatitude())))
				&& ((this.getDeviceLongitude() == castOther
						.getDeviceLongitude()) || (this.getDeviceLongitude() != null
						&& castOther.getDeviceLongitude() != null && this
						.getDeviceLongitude().equals(
								castOther.getDeviceLongitude())))
				&& ((this.getDeviceCnttotal() == castOther.getDeviceCnttotal()) || (this
						.getDeviceCnttotal() != null
						&& castOther.getDeviceCnttotal() != null && this
						.getDeviceCnttotal().equals(
								castOther.getDeviceCnttotal())))
				&& ((this.getDeviceSuccess() == castOther.getDeviceSuccess()) || (this
						.getDeviceSuccess() != null
						&& castOther.getDeviceSuccess() != null && this
						.getDeviceSuccess()
						.equals(castOther.getDeviceSuccess())))
				&& ((this.getDeviceDisplay() == castOther.getDeviceDisplay()) || (this
						.getDeviceDisplay() != null
						&& castOther.getDeviceDisplay() != null && this
						.getDeviceDisplay()
						.equals(castOther.getDeviceDisplay())))
				&& ((this.getDevicePinpad() == castOther.getDevicePinpad()) || (this
						.getDevicePinpad() != null
						&& castOther.getDevicePinpad() != null && this
						.getDevicePinpad().equals(castOther.getDevicePinpad())))
				&& ((this.getDevicePrinter() == castOther.getDevicePrinter()) || (this
						.getDevicePrinter() != null
						&& castOther.getDevicePrinter() != null && this
						.getDevicePrinter()
						.equals(castOther.getDevicePrinter())))
				&& ((this.getDeviceKeyboard() == castOther.getDeviceKeyboard()) || (this
						.getDeviceKeyboard() != null
						&& castOther.getDeviceKeyboard() != null && this
						.getDeviceKeyboard().equals(
								castOther.getDeviceKeyboard())))
				&& ((this.getDeviceReader() == castOther.getDeviceReader()) || (this
						.getDeviceReader() != null
						&& castOther.getDeviceReader() != null && this
						.getDeviceReader().equals(castOther.getDeviceReader())))
				&& ((this.getDeviceAddress() == castOther.getDeviceAddress()) || (this
						.getDeviceAddress() != null
						&& castOther.getDeviceAddress() != null && this
						.getDeviceAddress()
						.equals(castOther.getDeviceAddress())))
				&& ((this.getDeviceInstalldate() == castOther
						.getDeviceInstalldate()) || (this
						.getDeviceInstalldate() != null
						&& castOther.getDeviceInstalldate() != null && this
						.getDeviceInstalldate().equals(
								castOther.getDeviceInstalldate())))
				&& ((this.getPosNo() == castOther.getPosNo()) || (this
						.getPosNo() != null && castOther.getPosNo() != null && this
						.getPosNo().equals(castOther.getPosNo())))
				&& ((this.getShopNo() == castOther.getShopNo()) || (this
						.getShopNo() != null && castOther.getShopNo() != null && this
						.getShopNo().equals(castOther.getShopNo())))
				&& ((this.getInstNo() == castOther.getInstNo()) || (this
						.getInstNo() != null && castOther.getInstNo() != null && this
						.getInstNo().equals(castOther.getInstNo())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getFactoryId() == null ? 0 : this.getFactoryId().hashCode());
		result = 37 * result
				+ (getModelId() == null ? 0 : this.getModelId().hashCode());
		result = 37 * result
				+ (getDeviceSn() == null ? 0 : this.getDeviceSn().hashCode());
		result = 37
				* result
				+ (getDeviceCode() == null ? 0 : this.getDeviceCode()
						.hashCode());
		result = 37
				* result
				+ (getDeviceStatus() == null ? 0 : this.getDeviceStatus()
						.hashCode());
		result = 37
				* result
				+ (getDeviceAttach() == null ? 0 : this.getDeviceAttach()
						.hashCode());
		result = 37
				* result
				+ (getDeviceLatitude() == null ? 0 : this.getDeviceLatitude()
						.hashCode());
		result = 37
				* result
				+ (getDeviceLongitude() == null ? 0 : this.getDeviceLongitude()
						.hashCode());
		result = 37
				* result
				+ (getDeviceCnttotal() == null ? 0 : this.getDeviceCnttotal()
						.hashCode());
		result = 37
				* result
				+ (getDeviceSuccess() == null ? 0 : this.getDeviceSuccess()
						.hashCode());
		result = 37
				* result
				+ (getDeviceDisplay() == null ? 0 : this.getDeviceDisplay()
						.hashCode());
		result = 37
				* result
				+ (getDevicePinpad() == null ? 0 : this.getDevicePinpad()
						.hashCode());
		result = 37
				* result
				+ (getDevicePrinter() == null ? 0 : this.getDevicePrinter()
						.hashCode());
		result = 37
				* result
				+ (getDeviceKeyboard() == null ? 0 : this.getDeviceKeyboard()
						.hashCode());
		result = 37
				* result
				+ (getDeviceReader() == null ? 0 : this.getDeviceReader()
						.hashCode());
		result = 37
				* result
				+ (getDeviceAddress() == null ? 0 : this.getDeviceAddress()
						.hashCode());
		result = 37
				* result
				+ (getDeviceInstalldate() == null ? 0 : this
						.getDeviceInstalldate().hashCode());
		result = 37 * result
				+ (getPosNo() == null ? 0 : this.getPosNo().hashCode());
		result = 37 * result
				+ (getShopNo() == null ? 0 : this.getShopNo().hashCode());
		result = 37 * result
				+ (getInstNo() == null ? 0 : this.getInstNo().hashCode());
		return result;
	}
}